#!/bin/sh

export args=$1

function sle_server_start()
{
	# 如果plat_soc.ko没有加载，那么就加载
	plat_soc=`lsmod | grep "plat_soc"`
	if [ -z "$plat_soc" ]; then
		insmod /ko/wifi/plat_soc.ko
	fi

	# 如果sle_soc.ko没有加载，那么就加载
	sle_soc=`lsmod | grep "sle_soc"`
	if [ -z "$sle_soc" ]; then
		insmod /ko/wifi/sle_soc.ko
	fi

	sleep 0.5;
	sle_server_sample &
}

function sle_server_stop()
{
	killall sle_server_sample
	sleep 1;
	rmmod sle_soc.ko
}

case $args in
	start)
		sle_server_start
		;;
	stop)
		sle_server_stop
		;;
	-h)
		echo 'Options: start stop '
		;;
	*)
		echo 'Use '-h' to display command line options of sub-processes'
		;;
esac
